//
// Created by liushuai on 2020/2/13.
//
#include "isAnagram.h"
map<char,int> count(string s){
    map<char,int> result;
    for(auto elem:s){
        if(result.count(elem)){
            result[elem] += 1;
        }else{
            result[elem] =1;
        }
    }
    return result;
}
bool isAnagram(string s,string t){
    if(t.size()!=s.size())
        return false;
    else{
        map<char,int> sMap = count(s);
        map<char,int> tMap = count(t);
        if(sMap == tMap)
            return true;
        else
            return false;
    }
}